package com.ruoyi.eqmonitor.dispose.controller;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.eqmonitor.dispose.domain.ExteriorSite;
import com.ruoyi.eqmonitor.dispose.service.ExteriorSiteService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 已经弃用，微站明细在smdtv_9
 */
@Api(tags = "微站站点明细")
@RestController
@RequestMapping("/siteInfo")
public class ExteriorSiteController extends BaseController {

    @Autowired
    private ExteriorSiteService exteriorSiteService;

    /**
     * 微站明细列表
     */
    @GetMapping("/list")
    public TableDataInfo<?> list(ExteriorSite site){
        startPage();
        LambdaQueryWrapper<ExteriorSite> wrapper = Wrappers.lambdaQuery();
        wrapper.like(StrUtil.isNotEmpty(site.getSiteCode()), ExteriorSite::getSiteCode, site.getSiteCode());
        wrapper.like(StrUtil.isNotEmpty(site.getSiteName()), ExteriorSite::getSiteName, site.getSiteName());
        return getDataTable(exteriorSiteService.list(wrapper));
    }

}
